<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>修改密码</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css"/>
    <link href="../css/select.css" rel="stylesheet" type="text/css"/>
    <link href="../css/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="../css/common_impt.css">

</head>

<body>
<div id="top"></div>
<div id="left"></div>

<div id="right">
    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li><a href="#">首页</a></li>
            <li><a href="#">个人信息管理</a></li>
            <li><a href="#">修改密码</a></li>
        </ul>
    </div>

    <div class="formbody">
        <div id="usual1" class="usual">
            <div id="tab1" class="tabson">
                <ul class="forminfo">
                    <li><label>旧的密码<b>*</b></label><input id="oldPassword" type="password" class="dfinput" value="" placeholder="请填写旧的密码" style="width:518px;"/></li>

                    <li><label>新的密码<b>*</b></label><input id="conformPassword" type="password" class="dfinput" value="" placeholder="请填写新的密码" style="width:518px;"/></li>

                    <li><label>确认密码<b>*</b></label><input id="password" type="password" class="dfinput" value="" placeholder="请确认密码" style="width:518px;"/></li>

                    <li><label>&nbsp;</label><input id="modifyPasswordBtn" type="button" class="btn" value="确认修改"/></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
<script type="text/javascript" src="../js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="../js/select-ui.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="../js/public.js"></script>

<script type="text/javascript">
    $("#top").load('top.html');
    $("#left").load('teacher_left.html',function () {
        $(".menuson").hide();
        $(".menuson").eq(0).show();
        $(".menuson").eq(0).children('li').eq(1).addClass('active');
    });

    $(function () {

        $("#modifyPasswordBtn").click(function () {

            var userId = "0101";
            // userId = sessionStorage.getItem('userId');
            var param = {
                "userId" : userId,
                "oldPassword" : $("#oldPassword").val(),
                "password" : $("#password").val(),
                "conformPassword" : $("#conformPassword").val()
            };
            for (var paramKey in param) {
                if (!param[paramKey]) {
                    showTip("信息不能为空");
                    return;
                }
            }
            requests.postReq(urls.modifyPassword, JSON.stringify(param), function (result) {
                if (result.status === 1) {
                    showTip("密码修改成功",function () {
                        window.location.reload();
                    });
                } else if (result.message) {
                    showTip(result.message);
                } else {
                    showTip("服务器内部错误")
                }
            });
        });

    })

</script>
</body>
</html>
